package com.rerun.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rerun.common.util.JsonDateFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author dax.
 * @version v1.0
 * @since 2017/10/16 11:40
 */
@TableName("email_history")
public class EmailHistory extends Model<EmailHistory> {
    private static final long serialVersionUID = -9178927191472696112L;

    @TableId(type = IdType.UUID)
    private String id;
    private String toAddress;
    @JsonSerialize(using = JsonDateFormat.class)
    private Date createTime;
    private int emailType;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getToAddress() {
        return toAddress;
    }

    public void setToAddress(String toAddress) {
        this.toAddress = toAddress;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getEmailType() {
        return emailType;
    }

    public void setEmailType(int emailType) {
        this.emailType = emailType;
    }

    @Override
    public String toString() {
        return "{" +
                "id:" + id +
                ", toAddress:" + toAddress +
                ", createTime:" + createTime +
                ", emailType:" + emailType +
                '}';
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
